using Framework.Save;
using LitJson;
using UnityEngine;

namespace Framework
{
    public abstract class Model : IJsonSerializable
    {
        public abstract JsonData Serialize();
        public abstract void Deserialize(JsonData data);
    }

    public abstract class View<T> : MonoBehaviour where T : Model
    {
        public T Model { get; private set; }
        public void SetModel(T model) => Model = model;
    }

    public interface IController<TModel, TView>
        where TModel : Model
        where TView : View<TModel>
    {
        TModel Model { get; }
        TView View { get; }
    }

    public interface IFactory<T> where T : Model
    {
        
    }
}